package com.serverB.service;

import com.serverB.entity.User;
import com.serverB.mapper.UserMapper;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: wbk
 * @Date: 2024/3/1  14:57
 * @Description:
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    @Transactional
    public void add(){
        userMapper.insert(new User().setAge(22)
                .setName("user_b")
                .setCode("22"));

    }
}
